public class test6 {
    //力扣  1576 替换所有的问号
    public String modifyString(String ss) {
            char[] s = ss.toCharArray();
            for(int i = 0;i<s.length;i++){

                if(s[i]=='?'){

                    for(char ch = 'a';ch<='z';ch++){

                        if( (i==0 || ch!=s[i-1]) && (i==s.length-1) || ch!=s[i+1] ){
                            s[i] = ch;
                            break;
                        }
                    }
                }
            }

            return String.valueOf(s);
        }
}
